package com.woniuxy01;

import java.util.Comparator;

/**
 * @author 作者
 * @create 2025-06-04 9:46
 */
public class StudentAgeDesc implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        if(o1 instanceof Student && o2 instanceof Student){
            Student one = (Student)o1;
            Student two = (Student)o2;
            return two.getAge()-one.getAge();
        }
        return 0;
    }
}
